package cn.edu.scau.cmi.liujianxun.simpleFactoryMethod;

import cn.edu.scau.cmi.liujianxun.simpleFactoryMethod.insurance.*;

public class InsuranceFactory{
	public static Insurance getInstance(String i){
		Insurance policy = null;
		switch(i){
		case "司机受伤": policy = new BodyInjur();break;
		case "汽车损坏": policy = new Collision();break;
		case "人员伤亡": policy = new PersonInjur();break;
		case "多种事故": policy = new Comprehensive();break;
		default : break;
		}
		return policy;
	}
}
